#!/usr/bin/env bash

for t in $(mysql -uroot -proot -hhadoop3 -e 'use result;show tables'|awk ' NR !=1{print} ')
do
  t_desc=$(mysql -uroot -proot -hhadoop3 -e "use result;desc ${t}")
  if [[ $t_desc == *stationID* ]];then
    mysql -uroot -proot -hhadoop3 -e "use result;alter table ${t} modify column stationID char(10);"
  elif [[ $t_desc == *station_id* ]];then
    mysql -uroot -proot -hhadoop3 -e "use result;alter table ${t} modify column station_id char(10);"
  fi
done